<? 
 $objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("database");
mysql_query("SET NAMES UTF8");

$strSQL = "INSERT INTO  `clinic` (
`clinic_name` ,
`clinic_add` ,
`clinic_town` ,
`clinic_amphur` ,
`clinic_tambon` ,
`clinic_post` ,
`clinic_tel` ,
`clinic_open` ,
`clinic_web` ,
`chk1` ,
`chk2` ,
`chk3` ,
`chk4` ,
`chk5` ,
`chk6` ,
`chk7` ,
`chk8` ,
`chk9` ,
`chk10` ,
`chk11` ,
`chk12` ,
`chk13` ,
`chk14` ,
`chk15` ,
`chk16` ,
`chk17` ,
`chk18` ,
`chk19` ,
`chk20` ,
`chk21` ,
`chk22` ,
`chk23` ,
`chk24` ,
`chk25` ,
`chk26` ,
`chk27` ,
`chk28` ,
`chk29` ,
`chk30` ,
`chk31` ,
`Details` ,
`clinic_pic` ,
`clinic_lat` ,
`clinic_lon`
)
VALUES (  "."'".$_POST["clinic_name"]."','".$_POST["clinic_add"]."','".$_POST["clinic_town"]."',  '".$_POST["clinic_amphur"]."',  '".$_POST["clinic_tambon"]."',  '".$_POST["clinic_post"]."',  '".$_POST["clinic_tel"]."',  '".$_POST["clinic_open"]."',  '".$_POST["clinic_web"]."',  '".$_POST["chk1"]."',  '".$_POST["chk2"]."',  '".$_POST["chk3"]."',  '".$_POST["chk4"]."',  '".$_POST["chk5"]."',  '".$_POST["chk6"]."',  '".$_POST["chk7"]."',  '".$_POST["chk8"]."',  '".$_POST["chk9"]."',  '".$_POST["chk10"]."',  '".$_POST["chk11"]."',  '".$_POST["chk12"]."',  '".$_POST["chk13"]."',  '".$_POST["chk14"]."',  '".$_POST["chk15"]."',  '".$_POST["chk16"]."',  '".$_POST["chk17"]."',  '".$_POST["chk18"]."',  '".$_POST["chk19"]."',  '".$_POST["chk20"]."',  '".$_POST["chk21"]."',  '".$_POST["chk22"]."',  '".$_POST["chk23"]."',  '".$_POST["chk24"]."',  '".$_POST["chk25"]."',  '".$_POST["chk26"]."',  '".$_POST["chk27"]."',  '".$_POST["chk28"]."',  '".$_POST["chk29"]."',  '".$_POST["chk30"]."',  '".$_POST["chk31"]."',  '".$_POST["Details"]."', '".$_FILES["filUpload"]["name"]."', '".$_POST["clinic_lat"]."', '".$_POST["clinic_lon"]."'
)";
 
 
 
$objQuery = mysql_query($strSQL);
 
mysql_query("SET NAMES UTF8");
if($objQuery)

{
	 echo "<meta http-equiv='Content-Type'   charset='UTF-8' />";	
 	 echo '<script language="javascript" type="text/javascript"> alert("บันทึกข้อมูลแล้วค่ะ  ขอขอบคุณที่ร่วมเป็นส่วนหนึ่งกับเว็บไซต์ของเรา"); window.location.href="C-Dr-member.php"; </script>';
 }
else
{
echo "Error Save [".$strSQL."]";
}

 
mysql_close($objConnect);
?>
	 <?
	if(copy($_FILES["filUpload"]["tmp_name"],"myfile/".$_FILES["filUpload"]["name"]))
	{
 	}
?>


 <?   		$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
		$objDB = mysql_select_db("database");
		mysql_query("SET NAMES UTF8");
	if(copy($_FILES["filUpload1"]["tmp_name"],"myfile/".$_FILES["filUpload1"]["name"]))
	{
		$strSQL = "INSERT INTO files ";
		$strSQL .="(Name,FilesName) VALUES ('".$_POST["clinic_name"]."','".$_FILES["filUpload1"]["name"]."')";
		$objQuery = mysql_query($strSQL);		
 	}
	if(copy($_FILES["filUpload2"]["tmp_name"],"myfile/".$_FILES["filUpload2"]["name"]))
	{
		$strSQL = "INSERT INTO files ";
		$strSQL .="(Name,FilesName) VALUES ('".$_POST["clinic_name"]."','".$_FILES["filUpload2"]["name"]."')";
		$objQuery = mysql_query($strSQL);		
 	}
	if(copy($_FILES["filUpload3"]["tmp_name"],"myfile/".$_FILES["filUpload3"]["name"]))
	{
		$strSQL = "INSERT INTO files ";
		$strSQL .="(Name,FilesName) VALUES ('".$_POST["clinic_name"]."','".$_FILES["filUpload3"]["name"]."')";
		$objQuery = mysql_query($strSQL);		
 	}
	if(copy($_FILES["filUpload4"]["tmp_name"],"myfile/".$_FILES["filUpload4"]["name"]))
	{
		$strSQL = "INSERT INTO files ";
		$strSQL .="(Name,FilesName) VALUES ('".$_POST["clinic_name"]."','".$_FILES["filUpload4"]["name"]."')";
		$objQuery = mysql_query($strSQL);		
 	}
	if(copy($_FILES["filUpload5"]["tmp_name"],"myfile/".$_FILES["filUpload5"]["name"]))
	{
		$strSQL = "INSERT INTO files ";
		$strSQL .="(Name,FilesName) VALUES ('".$_POST["clinic_name"]."','".$_FILES["filUpload5"]["name"]."')";
		$objQuery = mysql_query($strSQL);		
 	}
	if(copy($_FILES["filUpload6"]["tmp_name"],"myfile/".$_FILES["filUpload6"]["name"]))
	{
		$strSQL = "INSERT INTO files ";
		$strSQL .="(Name,FilesName) VALUES ('".$_POST["clinic_name"]."','".$_FILES["filUpload6"]["name"]."')";
		$objQuery = mysql_query($strSQL);		
 	}
	if(copy($_FILES["filUpload7"]["tmp_name"],"myfile/".$_FILES["filUpload7"]["name"]))
	{
		$strSQL = "INSERT INTO files ";
		$strSQL .="(Name,FilesName) VALUES ('".$_POST["clinic_name"]."','".$_FILES["filUpload7"]["name"]."')";
		$objQuery = mysql_query($strSQL);		
 	}
	if(copy($_FILES["filUpload8"]["tmp_name"],"myfile/".$_FILES["filUpload8"]["name"]))
	{
		$strSQL = "INSERT INTO files ";
		$strSQL .="(Name,FilesName) VALUES ('".$_POST["clinic_name"]."','".$_FILES["filUpload8"]["name"]."')";
		$objQuery = mysql_query($strSQL);		
 	}
	if(copy($_FILES["filUpload9"]["tmp_name"],"myfile/".$_FILES["filUpload9"]["name"]))
	{
		$strSQL = "INSERT INTO files ";
		$strSQL .="(Name,FilesName) VALUES ('".$_POST["clinic_name"]."','".$_FILES["filUpload9"]["name"]."')";
		$objQuery = mysql_query($strSQL);		
 	}
	if(copy($_FILES["filUpload10"]["tmp_name"],"myfile/".$_FILES["filUpload10"]["name"]))
	{
		$strSQL = "INSERT INTO files ";
		$strSQL .="(Name,FilesName) VALUES ('".$_POST["clinic_name"]."','".$_FILES["filUpload10"]["name"]."')";
		$objQuery = mysql_query($strSQL);		
 	}
?>
  


 